<?php
    $search_params = !empty($this->search_params)?$this->search_params:array('keyword' => null, 'status' => null);
?>
<?php
    $param_page     = !empty($this->param_page)?$this->param_page:PARAM_PAGE_NAME;
    $query          = !empty($this->query)?'?'.http_build_query($this->query):'';
?>
<?php if ($this->pageCount > 1): ?>
	<ul class="cp_paging">
	 Page <?php echo $this->current ?> of <?php echo $this->pageCount?>:
		<?php if ($this->current == $this->first): ?>
			<li class="disabled">
				&laquo; <?php echo $this->translate('First') ?>
			</li>
		<?php else: ?>
			<li>
                <a href="<?php echo $this->url(array_merge(array('page' => $this->first), $search_params)); ?><?php echo $query ?>">
					&laquo; <?php echo $this->translate('First') ?>
				</a>
			</li>
		<?php endif; ?>
		<!-- Previous page link -->
		<?php if (isset($this->previous)): ?>
			<li>	
				<a href="<?php echo $this->url(array_merge(array('page' => $this->previous), $search_params)); ?><?php echo $query ?>">
					&lsaquo;
				</a> </li>
		<?php else: ?>
			<li class="disabled">&lsaquo;</li>
		<?php endif; ?>

		<!-- Numbered page links -->
		<?php foreach ($this->pagesInRange as $page): ?>
			<?php if ($page != $this->current): ?>
				<li>
					<a href="<?php echo $this->url(array_merge(array('page' => $page), $search_params)); ?><?php echo $query ?>">
						<?php echo $page; ?>
					</a></li>
			<?php else: ?>
				<li class="active"><?php echo $page; ?></li>
			<?php endif; ?>
		<?php endforeach; ?>
		<!-- Next page link -->
		<?php if (isset($this->next)): ?>
			<li><a href="<?php echo $this->url(array_merge(array('page' => $this->next), $search_params)); ?><?php echo $query ?>">
					&rsaquo;
				</a>
			</li>
		<?php else: ?>
			<li class="disabled">&rsaquo;</li>
		<?php endif; ?>
		<?php if ($this->current == $this->last): ?>
			<li class="disabled">
				<?php echo $this->translate('Last') ?> &raquo;
			</li>
		<?php else: ?>
			<li>
				<a href="<?php echo $this->url(array_merge(array('page' => $this->last), $search_params)); ?><?php echo $query ?>">
					<?php echo $this->translate('Last') ?>	&raquo;
				</a>
			</li>
		<?php endif; ?>
	</ul>
<?php endif; ?>